odoo.define('basic_info.PartnerOrderSummary', function (require) {
    "use strict";

    const FormRenderer = require("web.FormRenderer");
    const {Component} = owl;
    const {ComponentWrapper} = require("web.OwlCompatibility");
    const {useState} = owl.hooks;

    class PartnerOrderSummary1 extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }

        /**
         * @private
         */
        _add_lnr_checkbox(vals){
            alert(vals)
        }
    }

    class PartnerOrderSummaryCZLX extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }
    class PartnerOrderSummaryWHCD extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }
    class PartnerOrderSummaryZY extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }
    class PartnerOrderSummaryHYZK extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }
    class PartnerOrderSummaryXX extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }

    class PartnerOrderSummary2 extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }

    class PartnerOrderSummary4 extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }

    // 生活环境
    class PartnerOrderSummarySHHJ extends Component {
        partner = useState({});

        constructor(self, partner) {
            super();
            this.partner = partner;
        }
    }
    Object.assign(PartnerOrderSummarySHHJ, {
        template: "basic_info.shhj_checkbox"
    });

    Object.assign(PartnerOrderSummaryCZLX, {
        template: "basic_info.registeredPermanent_checkbox"
    });
    Object.assign(PartnerOrderSummaryWHCD, {
        template: "basic_info.educationCode_checkbox"
    });
    Object.assign(PartnerOrderSummaryZY, {
        template: "basic_info.workCode_checkbox"
    });
    Object.assign(PartnerOrderSummaryHYZK, {
        template: "basic_info.maritalStatusCode_checkbox"
    });
    Object.assign(PartnerOrderSummaryXX, {
        template: "basic_info.bloodTypeCode_checkbox"
    });

    Object.assign(PartnerOrderSummary1, {
        template: "basic_info.spec_pop_class_checkbox"
    });
    Object.assign(PartnerOrderSummary2, {
        template: "basic_info.diseasetext_check_bl_checkbox"
    });

    Object.assign(PartnerOrderSummary4, {
        template: "basic_info.insuranceCode_checkbox"
    });

    // 常住类型
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".registeredPermanent_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummaryCZLX,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });
    // 文化程度
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".educationCode_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummaryWHCD,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });
    // 职业
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".workCode_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummaryZY,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });
    // 婚姻状况
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".maritalStatusCode_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummaryHYZK,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });
    // 血型
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".bloodTypeCode_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummaryXX,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });

    // 人群分类
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".spec_pop_class_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummary1,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });

    // 暴露史
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".diseasetext_check_bl_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummary2,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });

    // 支付方式
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".insuranceCode_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummary4,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });


    // 生活环境
    FormRenderer.include({
        async _renderView() {
            await this._super(...arguments);
            for (const element of this.el.querySelectorAll(".shhj_checkbox")) {
                this._rpc({
                    model: "basic.info",
                    method: "read",
                    args: [this.state.data.id]
                }).then(data => {
                    (new ComponentWrapper(
                        this,
                        PartnerOrderSummarySHHJ,
                        useState(data[0])
                    )).mount(element);
                });
            }
        }
    });


})
